package com.ws.entity;

/**
 * @author 王硕
 * @version jdk21
 * @className SalesEmployee
 * @description
 * @date 2024/11/7 21:56
 */
public class SalesEmployee extends Employee {
    private double monthlySales;
    private double commissionRate;

    public SalesEmployee(String name, int birthdayMonth, double monthlySales, double commissionRate) {
        super(name, birthdayMonth);
        this.monthlySales = monthlySales;
        this.commissionRate = commissionRate;
    }
@Override
    public double getSalary(int month) {
        double baseSalary = super.getSalary(month) + monthlySales * commissionRate;
        return baseSalary;
    }

    public double getMonthlySales() {
        return monthlySales;
    }

    public double getCommissionRate() {
        return commissionRate;
    }
}
